import json
info1={'name':'tom','age':12}
string=json.dumps(info1)
info2=json.loads(string)
print(info1,'\n',string,'\n',info2)
f=open('test.json','w')
json.dump(info1,f)
f.close()
f=open('test.json','r')
content=json.load(f)
f.close()
print(content)
